{extend name="admin@public:base" /}
{block name="main-row-content"}
<div class="page-header">
	<h1>
		当前操作
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			添加角色
		</small>
	</h1>
</div><!-- /.page-header -->
<div class="row">
	<div class="col-xs-12">
		<!-- PAGE CONTENT BEGINS -->
		<form class="form-horizontal ajaxForm2" action="{:url('admin/Sys/admin_role_runedit')}" method="post">
			<!-- #section:elements.form -->
			<input type="hidden" name="id" value="{$role.id}">
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right" for="form-field-1"><span class="middle red">*</span>角色名称：</label>

				<div class="col-sm-10">
					<input type="text" name="title"  placeholder="请输入角色名称" value="{$role.title}" class="col-xs-7" />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 状态： </label>
				<div class="col-sm-10" style="padding-top:5px;">
					<input name="status" value="1" {$role.status?"checked":""} class="ace ace-switch ace-switch-6" type="checkbox">
					<span class="lbl">&nbsp;&nbsp;默认关闭</span>
				</div>
			</div>
			<div class="space-4"></div>
			<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
				<tbody>
					<tr>
					    <td height="30" style="padding-left:10px;border-bottom:#CCCCCC solid 1px; line-height:25px; background-color:#F4F8FB">
					        <label class="pos-rel"><input type="checkbox" class="ace ace-checkbox-2" id="chkAll" onclick="CheckAll(this.form)" value="全选"/><span class="lbl"> 权限全选</span></label>
					    </td>
					</tr>
					<!-- 一级 -->
					{foreach name="auth_menu" item="vo"}
					<tr>
					    <td height="40" style="border-bottom:#CCCCCC solid 1px;padding-left:10px;">
					        <label><input {if condition="in_array($vo.id,$role.ids)""}checked{/if} name="rules[]" class="ace ace-checkbox-2 checkbox-parent" type="checkbox" value="{$vo.id}" dataid="id-{$vo.id}"/><span class="lbl"><strong>{$vo.title}</strong></span></label>
					    </td>
					</tr>
					{if condition="!empty($vo.child)"}
					<!-- 二级 -->
					  {foreach name="$vo.child" item="vv"}
					    <tr>
						    <td height="30" style="padding-left:{$vv.level*15}px;border-bottom:#E7EBF8 dashed 1px; color:#333333">
						        <label><input  {if condition="in_array($vv.id,$role.ids)""}checked{/if}   name="rules[]" ] class="ace ace-checkbox-2 checkbox-parent checkbox-child" type="checkbox" value="{$vv.id}" dataid="id-{$vo.id}-{$vv.id}"/><span class="lbl"> {$vv.title}</span></label>
						    </td>
					   </tr>
					   {if condition="!empty($vv.child)"}
					   <tr>
								<td height="30" style="padding-left:{$vv.level*30}px;border-bottom:#E7EBF8 dashed 1px; color:#666666">
								<!-- 三级 -->
								{foreach name="$vv.child" item="vvv"}
									<label class="thopen">
										<input  {if condition="in_array($vvv.id,$role.ids)""}checked{/if}  name="rules[]" class="ace ace-checkbox-2 checkbox-child" type="checkbox"  value="{$vvv.id}" dataid="id-{$vo.id}-{$vv.id}-{$vvv.id}">
										<span class="lbl" style="margin-right:20px;"> {$vvv.title}</span>
									</label>
									{if condition="!empty($vvv.child)"}
									<!-- 四级 -->
									  {foreach name="$vvv.child" item="vvvv"}
									     <label class="thopen">
											<input  {if condition="in_array($vvvv.id,$role.ids)""}checked{/if}  name="rules[]" class="ace ace-checkbox-2 checkbox-child" type="checkbox" value="{$vvvv.id}"  dataid="id-{$vo.id}-{$vv.id}-{$vvv.id}-{$vvvv.id}">
											<span class="lbl" style="margin-right:20px;"> {$vvvv.title}</span>
									    </label>
									  {/foreach}
									{/if}
								{/foreach}
								</td>
					       
					       </tr>
					   {/if}
					  {/foreach}
					{/if}
					{/foreach}
				</tbody>
			</table>
			<div class="clearfix">
				<div class="col-md-offset-3 col-md-9 ">
					<button class="btn btn-info btn-sm btn-radius" type="submit">
						<i class="ace-icon fa fa-check bigger-110"></i>
						提交并保存
					</button>

					&nbsp; &nbsp; &nbsp;
					<button class="btn btn-success btn-sm btn-radius" type="submit">
						<i class="ace-icon fa fa-undo bigger-110"></i>
						重置
					</button>
				</div>
			</div>

			
		</form>
	</div><!-- /.col -->
</div><!-- /.row -->
{/block}
   </body>
</html>